import React, { Component, Fragment } from 'react';
import { Row, Card, Col, Tabs, Button } from 'antd';
import MaintainRXD from './components/MaintainRXD';
import MaintainCXD from './components/MaintainCXD';
import MaintainYSJG from './components/MaintainYSJG';
import MaintainQL from './components/MaintainQL';
import SjsbYlyb from './SjsbYlyb';
import Yqyb from './components/Yqyb/Yqyb';
import PipingRoad from './PipingRoad';
import PipesPlan from './components/PipesPlan/PipesPlan';
import styles from './Maintain.less';
import { connect } from 'dva';

const TabPane = Tabs.TabPane;

@connect(({ global }) => ({
  currentUrl: global.currentUrl,
}))
class Maintain extends Component {
  constructor(props) {
    super(props);
  }

  componentWillMount() {
    const { dispatch, match } = this.props;
    dispatch({ type: 'global/fetchUrl', payload: match.url });
  }

  render() {
    return (
      <div style={{ padding: '10px' }}>
        <Tabs defaultActiveKey="1">
          <TabPane tab="人行道养护" key="1">
            <MaintainRXD />
          </TabPane>
          <TabPane tab="车行道养护" key="2">
            <MaintainCXD />
          </TabPane>
          <TabPane tab="雨水井盖养护" key="3">
            <MaintainYSJG />
          </TabPane>
          <TabPane tab="桥梁养护" key="4">
            <MaintainQL />
          </TabPane>
          <TabPane tab="一路一表" key="5">
            <SjsbYlyb />
          </TabPane>
          <TabPane tab="一桥一表" key="6">
            <Yqyb />
          </TabPane>
          <TabPane tab="管道一路一表" key="7">
            <PipingRoad />
          </TabPane>
          <TabPane tab="管道养护计划" key="8">
            <PipesPlan />
          </TabPane>
        </Tabs>
      </div>
    );
  }
}

export default Maintain;
